package com.sgam.mf.domain.ref;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "REF_COMPANY")
public class RefCompany extends AbstractRefEntity {
	
	@Column(name = "bossname") 
	private String bossname;
	
	@Column(name = "logoname") 
	private String logoname;
	
	@Column(name = "address") 
	private String address;
	
	@Column(name = "idno") 
	private String idno;
	
	@Column(name = "tva") 
	private String tva;
	
	@Column(name = "cont") 
	private String cont;
	
	@Column(name = "bank_code") 
	private String bankCode;
	
	@Column(name = "phone") 
	private String phone;
	
	@ManyToOne
	@JoinColumn(name = "ref_bank_fk", nullable = true)	
    private RefBank refBank;
	
	@Transient
	private String companyFiscDate;
	
	@Column(name = "contabil") 
	private String contabil;

	public String getBossname() {
		return bossname;
	}

	public void setBossname(String bossname) {
		this.bossname = bossname;
	}

	public String getLogoname() {
		return logoname;
	}

	public void setLogoname(String logoname) {
		this.logoname = logoname;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getIdno() {
		return idno;
	}

	public void setIdno(String idno) {
		this.idno = idno;
	}

	public String getTva() {
		return tva;
	}

	public void setTva(String tva) {
		this.tva = tva;
	}

	public String getCont() {
		return cont;
	}

	public void setCont(String cont) {
		this.cont = cont;
	}

	public String getBankCode() {
		return bankCode;
	}

	public void setBankCode(String bankCode) {
		this.bankCode = bankCode;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public RefBank getRefBank() {
		return refBank;
	}

	public void setRefBank(RefBank refBank) {
		this.refBank = refBank;
	}

	public String getCompanyFiscDate() {
		String ret="";
		if (getMdValue()!=null){
			ret=getMdValue();
		}
		if (getAddress()!=null) {
			ret=ret+", "+getAddress();
		}
		if (getCont()!=null) {
			ret=ret+", c/d: "+getCont();		
				}
		if (getRefBank()!=null) {
			ret=ret+", "+getRefBank().getMdValue();
		}
		if (getBankCode()!=null) {
			ret=ret+", c/b: "+getBankCode();
		}
		return ret;
	}

	public String getContabil() {
		return contabil;
	}

	public void setContabil(String contabil) {
		this.contabil = contabil;
	}
	
	

}
